home *** CD-ROM | disk | FTP | other *** search
/ CD Actual Thematic 15: Shareware / PC Actual CDT 15.iso / files / Windows_95_98 / Programacion / ActiveX / NCTWavPlayer.exe / Main / frmAbout.frm (.txt) next >
Encoding:
Visual Basic Form  |  2000-03-06  |  8.5 KB  |  193 lines

  1. VERSION 5.00
  2. Begin VB.Form frmAbout 
  3.    BorderStyle     =   3  'Fixed Dialog
  4.    Caption         =   "About programm"
  5.    ClientHeight    =   870
  6.    ClientLeft      =   2790
  7.    ClientTop       =   3375
  8.    ClientWidth     =   5580
  9.    ClipControls    =   0   'False
  10.    Icon            =   "frmAbout.frx":0000
  11.    LinkTopic       =   "Form2"
  12.    MaxButton       =   0   'False
  13.    MinButton       =   0   'False
  14.    ScaleHeight     =   870
  15.    ScaleWidth      =   5580
  16.    ShowInTaskbar   =   0   'False
  17.    Begin VB.Label NKT 
  18.       Caption         =   "NCT"
  19.       BeginProperty Font 
  20.          Name            =   "Arial"
  21.          Size            =   8.25
  22.          Charset         =   204
  23.          Weight          =   700
  24.          Underline       =   0   'False
  25.          Italic          =   0   'False
  26.          Strikethrough   =   0   'False
  27.       EndProperty
  28.       Height          =   255
  29.       Left            =   1020
  30.       TabIndex        =   5
  31.       Top             =   120
  32.       Width           =   375
  33.    End
  34.    Begin VB.Label Label2 
  35.       Caption         =   "
  36.       BeginProperty Font 
  37.          Name            =   "Symbol"
  38.          Size            =   14.25
  39.          Charset         =   2
  40.          Weight          =   700
  41.          Underline       =   0   'False
  42.          Italic          =   0   'False
  43.          Strikethrough   =   0   'False
  44.       EndProperty
  45.       Height          =   315
  46.       Left            =   1500
  47.       TabIndex        =   4
  48.       Top             =   30
  49.       Width           =   255
  50.    End
  51.    Begin VB.Label Label5 
  52.       Caption         =   "1998-2000 NCT Company"
  53.       Height          =   195
  54.       Left            =   1920
  55.       TabIndex        =   3
  56.       Top             =   480
  57.       Width           =   3555
  58.    End
  59.    Begin VB.Label Label4 
  60.       Caption         =   "
  61.       BeginProperty Font 
  62.          Name            =   "Symbol"
  63.          Size            =   11.25
  64.          Charset         =   2
  65.          Weight          =   400
  66.          Underline       =   0   'False
  67.          Italic          =   0   'False
  68.          Strikethrough   =   0   'False
  69.       EndProperty
  70.       Height          =   315
  71.       Left            =   1680
  72.       TabIndex        =   2
  73.       Top             =   420
  74.       Width           =   195
  75.    End
  76.    Begin VB.Label Label3 
  77.       Caption         =   "Copyright"
  78.       Height          =   195
  79.       Left            =   960
  80.       TabIndex        =   1
  81.       Top             =   480
  82.       Width           =   675
  83.    End
  84.    Begin VB.Image Image1 
  85.       Height          =   870
  86.       Left            =   0
  87.       Picture         =   "frmAbout.frx":0442
  88.       Stretch         =   -1  'True
  89.       Top             =   0
  90.       Width           =   855
  91.    End
  92.    Begin VB.Label lblTitle 
  93.       Caption         =   "Application Title"
  94.       BeginProperty Font 
  95.          Name            =   "Arial"
  96.          Size            =   8.25
  97.          Charset         =   204
  98.          Weight          =   700
  99.          Underline       =   0   'False
  100.          Italic          =   0   'False
  101.          Strikethrough   =   0   'False
  102.       EndProperty
  103.       ForeColor       =   &H00000000&
  104.       Height          =   255
  105.       Left            =   1860
  106.       TabIndex        =   0
  107.       Top             =   120
  108.       Width           =   3615
  109.    End
  110. Attribute VB_Name = "frmAbout"
  111. Attribute VB_GlobalNameSpace = False
  112. Attribute VB_Creatable = False
  113. Attribute VB_PredeclaredId = True
  114. Attribute VB_Exposed = False
  115. Option Explicit
  116. ' Reg Key Security Options...
  117. Const READ_CONTROL = &H20000
  118. Const KEY_QUERY_VALUE = &H1
  119. Const KEY_SET_VALUE = &H2
  120. Const KEY_CREATE_SUB_KEY = &H4
  121. Const KEY_ENUMERATE_SUB_KEYS = &H8
  122. Const KEY_NOTIFY = &H10
  123. Const KEY_CREATE_LINK = &H20
  124. Const KEY_ALL_ACCESS = KEY_QUERY_VALUE + KEY_SET_VALUE + _
  125.                        KEY_CREATE_SUB_KEY + KEY_ENUMERATE_SUB_KEYS + _
  126.                        KEY_NOTIFY + KEY_CREATE_LINK + READ_CONTROL
  127.                      
  128. ' Reg Key ROOT Types...
  129. Const HKEY_LOCAL_MACHINE = &H80000002
  130. Const ERROR_SUCCESS = 0
  131. Const REG_SZ = 1                         ' Unicode nul terminated string
  132. Const REG_DWORD = 4                      ' 32-bit number
  133. Const gREGKEYSYSINFOLOC = "SOFTWARE\Microsoft\Shared Tools Location"
  134. Const gREGVALSYSINFOLOC = "MSINFO"
  135. Const gREGKEYSYSINFO = "SOFTWARE\Microsoft\Shared Tools\MSINFO"
  136. Const gREGVALSYSINFO = "PATH"
  137. Private Declare Function RegOpenKeyEx Lib "advapi32" Alias "RegOpenKeyExA" (ByVal hKey As Long, ByVal lpSubKey As String, ByVal ulOptions As Long, ByVal samDesired As Long, ByRef phkResult As Long) As Long
  138. Private Declare Function RegQueryValueEx Lib "advapi32" Alias "RegQueryValueExA" (ByVal hKey As Long, ByVal lpValueName As String, ByVal lpReserved As Long, ByRef lpType As Long, ByVal lpData As String, ByRef lpcbData As Long) As Long
  139. Private Declare Function RegCloseKey Lib "advapi32" (ByVal hKey As Long) As Long
  140. Private Sub cmdOK_Click()
  141.   Unload Me
  142. End Sub
  143. Private Sub Form_Load()
  144.      lblTitle.Caption = App.Title & " " & App.Major & "." & App.Minor & "." & App.Revision
  145. End Sub
  146. Public Function GetKeyValue(KeyRoot As Long, KeyName As String, SubKeyRef As String, ByRef KeyVal As String) As Boolean
  147.     Dim i As Long                                           ' Loop Counter
  148.     Dim rc As Long                                          ' Return Code
  149.     Dim hKey As Long                                        ' Handle To An Open Registry Key
  150.     Dim hDepth As Long                                      '
  151.     Dim KeyValType As Long                                  ' Data Type Of A Registry Key
  152.     Dim tmpVal As String                                    ' Tempory Storage For A Registry Key Value
  153.     Dim KeyValSize As Long                                  ' Size Of Registry Key Variable
  154.     '------------------------------------------------------------
  155.     ' Open RegKey Under KeyRoot {HKEY_LOCAL_MACHINE...}
  156.     '------------------------------------------------------------
  157.     rc = RegOpenKeyEx(KeyRoot, KeyName, 0, KEY_ALL_ACCESS, hKey) ' Open Registry Key
  158.     If (rc <> ERROR_SUCCESS) Then GoTo GetKeyError          ' Handle Error...
  159.     tmpVal = String$(1024, 0)                             ' Allocate Variable Space
  160.     KeyValSize = 1024                                       ' Mark Variable Size
  161.     '------------------------------------------------------------
  162.     ' Retrieve Registry Key Value...
  163.     '------------------------------------------------------------
  164.     rc = RegQueryValueEx(hKey, SubKeyRef, 0, _
  165.                          KeyValType, tmpVal, KeyValSize)    ' Get/Create Key Value
  166.                         
  167.     If (rc <> ERROR_SUCCESS) Then GoTo GetKeyError          ' Handle Errors
  168.     If (Asc(Mid(tmpVal, KeyValSize, 1)) = 0) Then           ' Win95 Adds Null Terminated String...
  169.         tmpVal = Left(tmpVal, KeyValSize - 1)               ' Null Found, Extract From String
  170.     Else                                                    ' WinNT Does NOT Null Terminate String...
  171.         tmpVal = Left(tmpVal, KeyValSize)                   ' Null Not Found, Extract String Only
  172.     End If
  173.     '------------------------------------------------------------
  174.     ' Determine Key Value Type For Conversion...
  175.     '------------------------------------------------------------
  176.     Select Case KeyValType                                  ' Search Data Types...
  177.     Case REG_SZ                                             ' String Registry Key Data Type
  178.         KeyVal = tmpVal                                     ' Copy String Value
  179.     Case REG_DWORD                                          ' Double Word Registry Key Data Type
  180.         For i = Len(tmpVal) To 1 Step -1                    ' Convert Each Bit
  181.             KeyVal = KeyVal + Hex(Asc(Mid(tmpVal, i, 1)))   ' Build Value Char. By Char.
  182.         Next
  183.         KeyVal = Format$("&h" + KeyVal)                     ' Convert Double Word To String
  184.     End Select
  185.     GetKeyValue = True                                      ' Return Success
  186.     rc = RegCloseKey(hKey)                                  ' Close Registry Key
  187.     Exit Function                                           ' Exit
  188. GetKeyError:      ' Cleanup After An Error Has Occured...
  189.     KeyVal = ""                                             ' Set Return Val To Empty String
  190.     GetKeyValue = False                                     ' Return Failure
  191.     rc = RegCloseKey(hKey)                                  ' Close Registry Key
  192. End Function
  193.